using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace CoVua
{
    public partial class uctrlBanCo : UserControl
    {
        public uctrlBanCo()
        {
            InitializeComponent();
        }

        protected Bitmap _picBanCo;

        [Browsable(true)]
        public Bitmap picBanCo
        {
            get
            {
                return _picBanCo;
            }
            set
            {
                _picBanCo = value;
            }
        }

        private void uctrlBanCo_Paint(object sender, PaintEventArgs e)
        {
            Graphics g = e.Graphics;
            if (picBanCo != null)
            {
                int width = picBanCo.Width;
                int height = picBanCo.Height;
                int x0 = (Width - width) / 2;
                int y0 = (Height - height) / 2;
                g.DrawImage(picBanCo, x0, y0, width, height);
            }
        }        
    }
}
